<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <![endif]-->
    <title>Home</title>
    <!-- BOOTSTRAP CORE STYLE CSS -->
    <link href="css/bootstrap.css" rel="stylesheet" />
    <!-- FONTAWESOME CSS -->
    <link href="css/font-awesome.css" rel="stylesheet" />
    <!-- STYLE SWITCHER CSS -->
    <link href="css/style-switcher.css" rel="stylesheet" />
    <!-- CUSTOM STYLE CSS -->
    <link href="css/style.css" rel="stylesheet" />
    <!-- THEME COLOR STYLE ( DY DEFAULT IT IS HAVING RED COLOR YOUR CAN CHANGE IT BY REPLACEING red.css TO blue.css) -->
    <link id="mainCSS" href="css/themes/red.css" rel="stylesheet" />
</head>
<body>
<div class="switcher" style="left:-95px;">
    <a id="switch-panel" class="hide-panel" style="text-decoration:none;padding-top:-5px;height: 44px">
        <i >></i>
    </a>
    <ul class="colors-list">
        <a style="font-size: 18px;font-weight: bold" href="index.html">返回首页</a>
    </ul>
</div>
<!-- STYLE SWITCHER DIV END-->
<div class="header-section">

    <div class="name-upper">
        <h1 class="name-logo"> 发布任务 </h1>
    </div>
</div>
<!--Main Header Section End-->
<div class="container subscribe-sec">
    <div class="row text-center">
        <div class="col-lg-8 col-md-8 col-sm-8 col-lg-offset-2 col-md-offset-2 col-sm-offset-2 col-xs-12">
            <h1 >  我们将对你发布的任务进行审核</h1>
            <hr />
            <h4 >请确保你发布的任务合法、符合要求</h4>
            <div class="subscribe">
                <div class="input-group">
                    <input type="file" id="cart" class="form-control input-set" placeholder="请上传你的身份证"/>
                    <span class="input-group-btn">
	<button class="btn btn-default btn-set" id="upload" type="button" >上传</button>
  </span>
                </div>
            </div>
        </div>
    </div>
</div>
<!--Subscribe Section End-->
<div class="about-sec" >
    <div class="container" >
        <div class="row text-center">
            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 bdr-b-r pad-o" >
                <i class="fa fa-ticket fa-5x" ></i>
                <h3 >不得色情</h3>
                <p>
                    任务内容不得存在色情信息
                </p>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 bdr-b-r pad-o" >
                <i class="fa fa-location-arrow fa-5x" ></i>
                <h3 >不得违法</h3>
                <p>
                    任务内容必须是在合法范围内
                </p>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 bdr-b pad-o" >
                <i class="fa fa-lightbulb-o fa-5x" ></i>
                <h3 >不得赖账</h3>
                <p>
                    佣金是多少就给多少，不得拖欠
                </p>
            </div>
        </div>
        <div class="row text-center">
            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 bdr-r pad-o" >
                <i class="fa fa-circle-o-notch fa-5x" ></i>
                <h3 > 不得虚假</h3>
                <p>
                    任务内容确保为真实信息，不得存在虚假信息
                </p>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 bdr-r pad-o" >
                <i class="fa fa-code fa-5x" ></i>
                <h3 >不得频繁</h3>
                <p>
                    不得频繁发布信息内容。每用户没周最多10个任务
                </p>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 pad-o" >
                <i class="fa fa-slack fa-5x" ></i>
                <h3 >不得原谅</h3>
                <p>
                    用户发布信息存在虚假、色情、违法等行为，不得原谅
                </p>
            </div>
        </div>
    </div>
</div>
<!--About Section End-->
<div class="container contact-sec">
    <div class="row text-center">
        <div class="col-lg-6 col-md-6 col-sm-6 col-lg-offset-3 col-md-offset-3 col-sm-offset-3 col-xs-12">
            <h1 > 任务发布内容</h1>
            <hr />
            <h4 >243/789 , New Block, Road Side Template, USA</h4>
            <br />
            <div class="form-group">
                <input id="name" type="text" class="form-control" required="required" placeholder="任务标题：XX任务" />
            </div>
            <div class="form-group">
                <input id="bounty" type="text" class="form-control" required="required" placeholder="佣金值：1~10000" />
            </div>
            <div class="form-group">
                <input id="method" type="text" class="form-control" required="required" placeholder="结算方式：日结/月结" />
            </div>
            <div class="form-group">
                <input id="phone" type="text" class="form-control" required="required" placeholder="联系方式：173xxxx7642" />
            </div>
            <div class="form-group">
                <input id="type" type="text" class="form-control" required="required" placeholder="任务类型：兼职/顺路/正工/暑假工" />
            </div>
            <div class="form-group">
                <textarea name="message" id="content" required="required" class="form-control" style="min-height: 80px;" placeholder="Message"></textarea>
            </div>
            <div class="form-group">
                <a href="#" onclick="addTask()" class="btn btn-info btn-lg btn-block btn-send">发布任务</a>
            </div>
        </div>
    </div>
</div>
<div id="footer">未来可期有限公司 COPYRIGHT (©) 2022 公司地址：四川省成都市武侯区 联系电话：0021-93123 邮箱：kaix.wang@dhcca.com</a></div>
</body>
<script src="js/jquery.min.js"></script>
<script src="js/style-switcher.js"></script>
<script>
    function addTask() {
        let task_name=$("#name").val();
        let task_bounty=$("#bounty").val();
        let payroll_method=$("#method").val();
        let contact=$("#phone").val();
        let task_type=$("#type").val();
        let task_content=$("#content").val();
        console.log(task_name,task_bounty,payroll_method,contact,task_type,task_content);
        $.ajax({
            url:"task/addTask",
            data:{
                "task_name":task_name,
                "task_bounty":task_bounty,
                "payroll_method":payroll_method,
                "contact":contact,
                "task_type":task_type,
                "task_content":task_content,
            },
            success:function (res) {
                if(res=="发布任务成功！"){
                    alert("发布成功！");
                    return window.location.href="index.html";
                }else{
                    alert("出错了！")
                }
            }
        })
    }

    $("#upload").click(function () {
        let file=$("#cart")[0].files[0];
        let formData=new FormData();
        formData.append("multipartFile",file);
        $.ajax({
            url:"fileUp",
            data:formData,
            contentType:false,
        })
    })
</script>
</html>